home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / TPRNTTXT.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  50 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   TPRNTTXT.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. $INCLUDE "DAS-NBT1.INC"
  19. COLOR 7, 0
  20. CLS
  21. ? "┌─────────────────────────────────────────────────────────────────────────
  22. ? "│  TprintLine  ( Row?,Col?,      Cols?,Text$,MidPos%,CrLf??,TabW?,Attr? )
  23. ? "│ fTprintLine% ( Row?,Col?,      Cols?,Text$,MidPos%,CrLf??,TabW?,Attr? )
  24. ? "│  TprintText  ( Row?,Col?,Rows?,Cols?,Text$,MidPos%,CrLf??,TabW?,Attr? )
  25. ? "│ fTprintText% ( Row?,Col?,Rows?,Cols?,Text$,MidPos%,CrLf??,TabW?,Attr? )
  26. ? "├─────────────────────────────────────────────────────────────────────────
  27. ? "│ Printing and displaying texts no longer needs to be the arduous ordeal it
  28. ? "│ once was. These two powerful routines handle the problem with ease. The
  29. ? "│ functions return the next that will be required for MidPos%. TabW? is
  30. ? "│ the number of spaces a TAB or CHR$(9) is to be expanded to. If you send
  31. ? "│ ZERO then the CHR$(9)'s will be printed. Rows? and Cols? define the
  32. ? "│ bottom and right side of the line and/or box being printed into.
  33. ? "└─────────────────────────────────────────────────────────────────────────
  34.  
  35. Text$ = "Mary had a little lamb."        + CHR$(  13,  10) +_
  36.         "It's fleece was white as snow." + CHR$(&h0D,&h0A) +_  ' GET IT?
  37.         "And every where that Mary went" + CHR$(  13,  10) +_
  38.         "The lamb was sure to go."
  39.  
  40. L% = LEN( Text$ )
  41. R? = 16
  42. DO
  43.   MidPos% = fTprintLine%( R?, 1, 39, Text$, MidPos%, &h0D0A, 0, 112 )
  44.   INCR R?, 1
  45. LOOP UNTIL ( MidPos% > L% ) OR ( R? = 26 )
  46.  
  47. Rows? = 5
  48. X% = fTprintTEXT%( 16, 41, Rows?, 39, Text$, 1, &h0D0A, 0, 31 )
  49.  
  50. Tprint 25, 1, "An original poem by Anon!", 14